<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>添加订单</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_order.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<script src="__PUBLIC__/Plugins/Datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=6RQGXCYLSCZzLuPgZnnSMMrd"></script>
<style>
.attr{
	margin-left:30px;
}
.editbtn{
	background-color:#339900;
	color:#FFFFFF;
	padding:2px 4px;
	cursor:pointer;
}
.entitle{
	font-size:16px;
	font-weight:bold;
	display:inline-block;
	width:120px;
}
.ele_title{
	align:center
}
.attr_list{
	/*background-color:green;
	color:#FFFFFF;*/
	margin-right:15px;
}
.attr_tr{
	background:#FF9933;
	color:#FFFFFF;
}
.delPro{
	background-color:#FF6600;
	color:#FFFFFF;
	padding:3px 7px;
	cursor:pointer;
}
.search{
	background-color:#339900;
	color:#FFFFFF;
	padding:4px 10px;
	cursor:pointer;
	border:0px;
}
.tianjia{
	float:right;
	background-color:#339900;
	color:#FFFFFF;
	padding:3px 7px;
	cursor:pointer;
	margin:5px 30px 5px;
}
.other{
	background-color:#339900;
	color:#FFFFFF;
	padding:4px 7px;
	cursor:pointer;
	margin-right:20px;
	border:0px;
}
.dtitle{
	font-weight:bold;
}
.hover{
	background:#BFDAE3;
}
</style>
</head>

<body>
<div class="mask"></div>
	<div class="page_header">
		<div class="tabbar">
			<ul class="tab clearfix" tabname="tab1">
				<li class="tabhover" show="tab1_a">会员信息</li>
				<li show="tab1_0" class="tab1_0" style="display:none">配送信息</li>
				<li show="tab1_1">选择餐厅</li>
				<li show="tab1_2">选择菜品</li>
				<li show="tab1_3">其他信息</li>
			</ul>
		</div>
	</div>
	<div class="page_wraper">
	<form method="post" id="memberAdd_form">
	
		<input type="hidden"  name="dataid"    id="dataid"    value="">
		<input type="hidden"  name='addid'     id="addid"     value="">
		<input type="hidden"  name='pointlng'  id='pointlng'  value="">
		<input type="hidden"  name='pointlat'  id='pointlat'  value="">
		<input type="hidden"  name='servefee'  id='servefee'  value="">
		<input type="hidden"  name='servetime' id='servetime' value="">
		<input type="hidden"  name="memaddid"  id="memaddid"  value="">
		
		<div id="tab1_a" fortab="tab1">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
				<tr>
					<td class="ele_title"><label for="cardnum">电话：<em>*</em></label></td>
					<td class="ele_content" colspan="3" id="membercontent">
						<input name="mobile" value="{$detail.mobile}" type="text" id="mobile" class="form_ele_text width_200"
						placeholder="请输入电话或邮箱搜索">
						<a id="search" class="search">搜索</a>&nbsp;
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="cardnum">姓名：<em>*</em></label></td>
					<td class="ele_content" colspan="3" id="membername">
						<input name="username" value="{$detail.username}" type="text" id="realname" class="form_ele_text width_200"
						placeholder="请输入客户姓名">
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">邮箱：</label></td>
					<td class="ele_content" colspan="3">
						<input name="email" value="{$detail.email}" type="text" id="email" class="form_ele_text width_400"
						placeholder="请输入客户邮箱，选填">
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">客户备注：</label></td>
					<td class="ele_content" colspan="3" id="content1"></td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">客服备注：</label></td>
					<td class="ele_content" colspan="3" id="remark1">
						
					</td>
				</tr>
				<tr>
					<td class="ele_title">选择城市：</td>
					<td colspan="3">
						<select name='cityid' id='cityid' class="form_ele_text">
							<option value="">请选择城市</option>
							<option value='850'>北京</option>
							<option value='866'>上海</option>
							<option value='867'>广州</option>
							<option value='930'>顺义</option>
						</select>
						&nbsp;&nbsp;<a id="selectNewAds" style="cursor:pointer">添加新地址？</a>
					</td>
				</tr>
				<tr id="addresstr">
					<td class="ele_title"><label for="realname">地址列表：</label></td>
					<td class="ele_content" colspan="3" id="addresstd">
						
					</td>
				</tr>
			</table>
		</div>
		<div id="tab1_0" fortab="tab1" style="display:none;">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
				<tr>
					<td class="ele_title" ><label for="realname">选择地址</label></td>
					<td colspan="3" style="height:30px;">
						<a class="other site">选择常用地址</a>
						<a class="other map">通过地图标点</a>
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">常用地址：<em>*</em></label></td>
					<td class="ele_content" colspan="3">
						<input name="ads" type="text"  id="address" class="form_ele_text width_500"
						placeholder="请通过常用地址或地图选址确定客户具体位置，然后补充详细地址" readonly>
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">详细地址：<em>*</em></label></td>
					<td class="ele_content" colspan="3">
						<input name="detail" type="text"  id="address" class="form_ele_text width_500"
						placeholder="请通过常用地址或地图选址确定客户具体位置，然后补充详细地址">
					</td>
				</tr>
				<tr>
					<td colspan="4" style="height:30px;"></td>
				</tr>
			</table>
		</div>
		<div id="tab1_1" fortab="tab1" class="clearfix" style="display:none;">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
				<tr>
					<td class="ele_title">&nbsp;</td>
					<td>
						<select name='cuisine' id='cuisine'>
							<option value="">请选择菜系</option>
						</select>
						<input type="text" name="keywords" id="keywords" class="form_ele_text" placeholder="请输入关键字搜索">
						<input type="button" id="serarchRestaurant" class="other" value="搜索">
						
					</td>
				</tr>
				<tr>
					<td class="ele_title">选择餐厅</td>
					<td>
						<input type="hidden" id="clickOutlet">
						<select name="outletid" id="restaurant" style="width:290px">
							<option value="">请选择餐厅</option>
						</select>
						<a class="other viewrestaurant">查看餐厅信息</a>
					</td>
				</tr>
				<tr id="peisong" style="display:none">
					<td class="ele_title">&nbsp;</td>
					<td>
						距离：<span id='juli'></span>，配送时间：<span id='shijian'></span>，配送费用：￥<span id='feiyong'></span>
					</td>
				</tr>
			</table>
		</div>
		<div id="tab1_2" fortab="tab1" class="clearfix" style="display:none;">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
				<tr>
					<td class="ele_title">&nbsp;</td>
					<td>
						<input type="button" class="other selectproduct" value="选择菜品">&nbsp;&nbsp;&nbsp;
						<input type="button" class="other selectdrink" value="选择饮品">
					</td>
				</tr>
				<tr>
					<input type="hidden" id="clickproduct">
					<table cellpadding="0" cellspacing="0" class="module_form" width="600" id="producttable">
						<tr>
							<td class="ele_title">菜品编号</td>
							<td class="ele_title">菜品名称</td>
							<td class="ele_title">菜品单价</td>
							<td class="ele_title">数量</td>
							<!--<td class="ele_title">小计</td>-->
							<td width="170" class="ele_title">操作</td>
						</tr>
					</table>
				</tr>
			</table>
		</div>
		<div id="tab1_3" fortab="tab1" class="clearfix" style="display:none;">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
				<tr id="fapiao_tr">
					<td class="ele_title" width="15%"><label for="cardnum">发票：<em>*</em></label></td>
					<td class="ele_content">
						<input type="radio" value="0" name="isinvoice" class="" checked>不需要&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="radio" value="1" name="isinvoice" class="">需要&nbsp;&nbsp;
						<input type="text"  name="invoice_title" id="invoice_title" class="form_ele_text width_300" style="display:none"
						placeholder="请输入发票抬头">
					</td>
					<td colspan="2"></td>
				</tr>
				<tr>
					<td class="ele_title" width="15%"><label for="cardnum">打印：<em>*</em></label></td>
					<td class="ele_content">
						<input type="radio" value="0" name="isprint" class="" checked>不需要&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="radio" value="1" name="isprint" class="">需要&nbsp;&nbsp;
					</td>
					<td colspan="2"></td>
				</tr>
				<eq name='isdrink' value='1'>
					<!--<tr>
						<td class="ele_title"><label for="cardnum">免费饮料：<em>*</em></label></td>
						<td class="ele_content">
							<volist name='sdrink' id='v'>
								<input type="radio" value="{$key}" name="isdrink" class="" 
								<eq name='key' value='0'>checked</eq>>{$v.zh-cn}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</volist>
						</td>
						<td colspan="2"></td>
					</tr>-->
				</eq>
				<tr>
					<td class="ele_title"><label for="realname">订单客人备注：</label></td>
					<td class="ele_content" colspan="3">
						<textarea name="content" cols="" rows="" id="content" class=""></textarea>
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">订单客服备注：</label></td>
					<td class="ele_content" colspan="3">
						<textarea name="remark" cols="" rows="" id="remark" class=""></textarea>
					</td>
				</tr>
			</table>
		</div>
		</form>
	</div>
	<div class="page_footer pdtd10" id="page_footer1" style="display:none">
		<input type="button" name="submit" id="submit" value="提交数据"  class="form_ele_submit"/>
		<input type="reset"  name="reset"  id="reset"   value="清空数据"  class="form_ele_reset"/>
	</div>
</body>
<script type="text/javascript">
	$('.fj_ico i').on('click',function(){
		$(this).siblings('.fj_content').show();
		$('.mask').show();
	});
	$('.mask').on('click',function(){
			$('.fj_content').hide();
			$(this).hide();
	});
	
	$.get("{:U('Order/cartlist')}",function(data){
		var outletid = $('#restaurant').val();
		$('#producttable').html(data);
	});

	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;
	$(function(){
		
		//滑动门
		$('.tabbar li').click(function(){
			var tabname = $('.tabbar>ul').attr('tabname');
			$('.tabbar li').removeClass('tabhover');
			$(this).addClass('tabhover');
			
			if($(this).attr('show')=='tab1_3'){
				$('#page_footer1').show();
			}else{
				$('#page_footer1').hide();
			}
			$('div[fortab="'+tabname+'"]').hide();
			$('#'+$(this).attr('show')).show();
		});
		
		//表格隔行换色
		$('.module_form tr:odd').addClass('odd');
		$('.module_form tr:even').addClass('even');
		
		//重置
		$('.form_ele_reset').on('click',function(){
			$('#memberAdd_form').get(0).reset();
		});
		
		//显示配送信息栏
		$('#selectNewAds').live('click',function(){
			$('#tab1_0').show();
			$('.tab1_0').show();
			$('#tab1_a').hide();
			$('.tabbar li').removeClass('tabhover');
			$('.tab1_0').addClass('tabhover');
			$('#addressid').val('');
		});
		
		//选择会员地址
		$('#addressid').live('change',function(){
			var id     = $(this).val();
			var userid = $('#memberid').val();
			if(id){
				$.get("{:U('Order/add')}",{id:id,userid:userid,type:'adsdetail'},function(data){
					$('#pointlng').val(data.longitude);
					$('#pointlat').val(data.latitude);
					$('#address').val(data.address);
					$('#memaddid').val(data.id);
					getRestaurant();
				});
			}else{
				$('#addid').val('');
				$('#pointlng').val('');
				$('#pointlat').val('');
				$('#address').val('');
				$('#memaddid').val('');
			}
		});
		
		//模糊搜索会员
		$('#search').on('click',function(){
			$('#memberid').remove();
			$('#memberid').remove();
			$('#Custom_view').remove();
			$('#addcustom').remove();
			$('#Custom_edit').remove();
			var keywords = $('#mobile').val();
			$.get("{:U('Order/add')}",{keywords:keywords,type:'member'},function(data){
				if(data.status==1){
					$('#mobile').val('');
					$('#email').val('');
					$('#realname').val('');
					$('#dataid').val('');
					$('#content').html('');
					$('#Custom_view').remove();
					$('#memberid').remove();
					//$('#addresstr').hide();
					$('.tab1_0').hide();
				}else{
					$('.tab1_0').show();
				}
				$('#membercontent').append(data.html);
			});
		});
		
		//获取会员详细资料
		$('#memberid').live('change',function(){
			
			var id   = $(this).val();
			$('#Custom_view').remove();
			$('#Custom_edit').remove();
			
			if(id){
				$.get("{:U('Order/add')}",{id:id,type:'mdetail'},function(data){
					
					var html = '&nbsp;&nbsp;&nbsp;<a id="Custom_view" cid="'+data.data.id+'" class="openwin search">查看会员信息</a>\
								&nbsp;&nbsp;&nbsp;<a id="Custom_edit" cid="'+data.data.id+'" class="openwin search">修改会员信息</a>';
					
					$('#mobile').val(data.data.mobile);
					$('#email').val(data.data.email);
					$('#realname').val(data.data.realname);
					$('#dataid').val(data.data.id);
					$('#content1').html(data.data.remark);
					$('#content').html(data.data.remark);
					$('#remark1').html(data.data.remark1);
					$('#remark').val(data.data.remark1);
					$('#membercontent').append(html);
					$('#addresstr').show();
					$('#addresstd').html(data.html);
				});
			}else{
				$('#mobile').val('');
				$('#email').val('');
				$('#realname').val('');
				$('#dataid').val('');
				$('#content').html('');
				$('#Custom_view').remove();
				$('#Custom_edit').remove();
				//$('#addresstr').hide();
				$('#remark').val('');
			}
		});
		
		//查看会员信息
		$('#Custom_view').live('click',function(){
			var id     = $(this).attr('cid');
			var href   = "{:U('Custom/view')}&id="+id;
			var width  = '920px';
			var height = '450px';
			var title  = '会员信息';
			openDialog('Custom_view',href,width,height,title);
		});
		
		//修改会员信息
		$('#Custom_edit').live('click',function(){
			var id     = $(this).attr('cid');
			var href   = "{:U('Custom/edit')}&id="+id;
			var width  = '920px';
			var height = '450px';
			var title  = '修改会员信息';
			openDialog('Custom_view',href,width,height,title);
		});
		
		//选择常用地址
		$('.site').on('click',function(){
			var cityid = $('#cityid').val();
			var href   = "{:U('Order/site')}&cityid="+cityid;
			var width  = '600px';
			var height = '400px';
			var title  = '选择常用地址';
			openDialog('Order_site',href,width,height,title);
		});
		
		//通过地图选址
		$('.map').on('click',function(){
			var cityid = $('#cityid').val();
			var href   = "{:U('Order/map')}&cityid="+cityid;
			var width  = '600px';
			var height = '400px';
			var title  = '通过地图选址';
			openDialog('Order_map',href,width,height,title);
		});

		//点击查找地址附近的餐厅
		$('#clickOutlet').on('click',function(){
			getRestaurant();
		});
		
		$('#addcustom').live('click',function(){
			var href   = "{:U('Custom/add')}";
			var width  = '900px';
			var height = '500px';
			var title  = '登记新会员';
			openDialog('Custom_add',href,width,height,title);
		});
		
		//查看餐厅信息
		$('.viewrestaurant').on('click',function(){
			var id = $('#restaurant').val();
			if(id){
				var href   = "{:U('Outlet/edit')}&id="+id;
				var width  = '1000px';
				var height = '500px';
				var title  = '查看餐厅详情';
				openDialog('Outlet_edit',href,width,height,title);
			}else{
				alert('请选择餐厅');return;
			}
		});

		//点击某个餐厅，查看是否提供发票
		$('#restaurant > option').live('click',function(data){
			var fapiao = $(this).attr('fapiao');
			if(fapiao == 2){
				$('#fapiao_tr').hide();
			}else{
				$('#fapiao_tr').show();
			}
		});
		
		//计算时间和运费
		$('#restaurant').on('change',function(){
			var restid   = $(this).val();
			var addid    = $('#addid').val();
			var pointlng = $('#pointlng').val();
			var pointlat = $('#pointlat').val();
			var cityid   = $('#cityid').val();
			
			if(restid){
				if(addid==""&&pointlng==""&&pointlat==""){
					windowApi.lhgdialog.alert('请通过常用地址或者地图选址确定客户具体位置');
				}else{
					$.get("{:U('Order/add')}",{restid:restid,addid:addid,pointlng:pointlng,pointlat:pointlat,cityid:cityid,type:'device'},function(data){
						$('#peisong').show();
						$('#juli').html(data.distance+'米');
						$('#shijian').html(data.time+'分钟');
						$('#feiyong').html(data.sever);
						$('#servefee').val(data.sever);
						$('#servetime').val(data.time);
						$('#clickproduct').click();//重新加载商品
					});
				}
			}else{
				$('#peisong').hide();
			}
		});
		
		//选择菜品
		$('.selectproduct').on('click',function(){
			var restid = $('#restaurant').val();
			var cityid = $('#cityid').val();
			var href   = "{:U('Product/index','order=1')}&id="+restid+"&cityid="+cityid;
			var width  = '1100px';
			var height = '530px';
			var title  = '选择菜品';
			openDialog('Product_index',href,width,height,title);
		});
		
		//选择饮品
		$('.selectdrink').on('click',function(){
			var cityid = $('#cityid').val();
			var restid = $('#restaurant').val();
			var href   = "{:U('Product/drink','order=1')}&cityid="+cityid+"&restid="+restid;
			var width  = '1000px';
			var height = '500px';
			var title  = '选择饮品';
			openDialog('Product_drink',href,width,height,title);
		});
		
		//异步加载菜系
		$('#cityid').change(function(data){
			
			var cityid   = $('#cityid').val();
			var memberid = $('#memberid').val();
			
			$.get("{:U('Order/add')}",{cityid:cityid,type:'cuisine'},function(data){
				$('#cuisine').html(data);
			});
			//$.get("{:U('Order/add')}",{cityid:cityid,type:'restaurant'},function(data){
			//	$('#restaurant').html(data);
			//});
			$.get("{:U('Order/add')}",{cityid:cityid,memberid:memberid,type:'memberads'},function(data){
				$('#addresstd').html(data);
			});
		});
		
		//根据菜系、关键字搜索餐厅
		$('#serarchRestaurant').on('click',function(){
			/*var cityid   = $('#cityid').val();
			var keywords = $('#keywords').val();
			var cuisine  = $('#cuisine').val();
			
			$.get("{:U('Order/add')}",{cityid:cityid,type:'restaurant',keywords:keywords,cuisine:cuisine},function(data){
				//$('#keywords').val('');
				//$('#cuisine').val('');
				$('#restaurant').html(data);
			});*/
			getRestaurant();
		});
		
		//点击查询购物车
		$('#clickproduct').on('click',function(){
			var outletid = $('#restaurant').val();
			var servefee = $('#servefee').val();
			$.get("{:U('Order/cartlist')}",{outletid:outletid,servefee:servefee},function(data){
				$('#producttable').html(data);
			});
		});
		
		//删除购物车某件商品
		$('.delPro').live('click',function(){
			var obj = $(this)
			var id  = $(this).attr('id');
			$.get("{:U('Order/delcart')}",{id:id},function(data){
				if(data.status==1){
					//obj.parents('tr').remove();
					$('#clickproduct').click();
				}else{
					alert(data.info);return;
				}
			});
		});
		
		//查看商品数量
		$('.selectattr').live('click',function(){
			var rel = $(this).attr('rel');
			if(rel=='show'){
				$(this).html('隐藏属性');
				$(this).attr('rel','hide');
				$(this).parents('tr').next('tr').addClass('hover');
				$(this).parents('tr').next('tr').show();
			}else{
				$(this).html('查看属性');
				$(this).attr('rel','show');
				$(this).parents('tr').next('tr').removeClass('hover');
				$(this).parents('tr').next('tr').hide();	
			}
		});

		//修改购物车商品数量
		$('.editnum').live('change',function(){
			var num = ~~$(this).val();
			var id  = $(this).attr('id');
			
			if(num<=0 || isNaN(num)){
				windowApi.lhgdialog.alert('请输入正整数');return;
			}
			
			$.get("{:U('Order/numcart')}",{id:id,num:num},function(data){
				if(data.status==1){
					$('#clickproduct').click();
				}else{
					windowApi.lhgdialog.alert(data.info);
				}
			});
		});
		
		//修改购物车商品数量
		/*$('.editnum').live('click',function(){
			var rel = $(this).attr('rel');
			var id  = $(this).attr('id');
			var num = parseInt($('#num'+id).html());
			
			if(rel=='minus'){
				if(num==1){
					return false;
				}else{
					num = num-1;
				}
			}else{
				num = num+1;
			}
			
			$.get("{:U('Order/numcart')}",{rel:rel,id:id,num:num},function(data){
				if(data.status==1){
					$('#clickproduct').click();
				}else{
					windowApi.lhgdialog.alert(data.info);
				}
			});
		});*/
		
		//添加商品属性
		$('#addattr').live('click',function(){
			var cid      = $(this).attr('cid');
			var dishesid = $(this).attr('dishesid');
			var href     = "{:U('Order/attrcart')}&dishesid="+dishesid+"&cid="+cid;
			var width    = '800px';
			var height   = '500px';
			var title    = '添加商品属性';
			openDialog('Order_attrcart',href,width,height,title);
		});
		
		//需要发票，显示发票抬头输入文本框
		$("input[name='isinvoice']").on('click',function(){
			var val = $(this).val();
			if(val==1){
				$('#invoice_title').show();
			}else{
				$('#invoice_title').hide();
			}
		});
		
		//更新菜品备注内容
		$(".asks").live("change",function(){
			var ask    = $(this).val();
			var cartid = $(this).attr("cartid");
			$.get("{:U('Order/add')}",{cartid:cartid,ask:ask,type:'asks'});
		});
		
		//提交表单
		$(".form_ele_submit").on("click",function(){
			
			var postData = {};
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			postData = $("#memberAdd_form").serialize();
			
			$.post("{:U('Order/add')}", postData ,function(d){
				if(d.status==1){
					tipsObj.close();
					windowApi.lhgdialog.tips('订单添加成功！',1,etIcon.success,function(){
						frameApi.close(); //关闭当前窗口
						var obj = windowApi.lhgdialog.list['Order_index'];
						if(obj){
							obj.reload(obj);
						}else{
							var href     = "{:U('Order/index')}";
							var width    = '1100px';
							var height   = '500px';
							var title    = '订单列表';
							openDialog('Order_index',href,width,height,title);
						}
					});
				}else{
					windowApi.lhgdialog.alert(d.info);
				}
			}, "json");
		});
	});

	//根据地址获取餐厅列表-根据距离排序
	function getRestaurant(cityid,pointlng,pointlat){
		var cityid   = $('#cityid').val();
		var pointlng = $('#pointlng').val();
		var pointlat = $('#pointlat').val();
		var keywords = $('#keywords').val();
		var cuisine  = $('#cuisine').val();
		
		$.get("{:U('Order/add')}",{cityid:cityid,pointlng:pointlng,pointlat:pointlat,keywords:keywords,cuisine:cuisine,type:'pointer'},function(data){
			if(data){
				$('#restaurant').html(data);
			}else{
				windowApi.lhgdialog.alert(data.info);
			}
		});
	}
</script>
</html>
